<?php
// unneeded session_start();

class Test_v_to_m_model extends CI_Model{
    
    public function display_user_name() {
        
        $whichfamily = '12';
        $which_user = '2';
        
        $query = $this->doctrine->em->createQuery("select u from ORM\Dynasties2\Characters u WHERE u.whichFamily = $whichfamily");
        //$result = $query->getResult();
        //print_r($result);
        return $query->getResult();
        
        //$user = $this->doctrine->em->find('ORM\Dynasties2\Users', $which_user);
        //$family = $this->doctrine->em->getRepository('ORM\Dynasties2\Famlilies')->findOneBy(array('email' => $other_field));
        //echo $user->getfirstName().' '.$user->getlastname().' is a real chill guy.<br />';
        //return $user->getfirstName();
        
        
       
        
        
    }
    
}